home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / pyshared / AppInstall / distros / __init__.py next >
Encoding:
Python Source  |  2009-03-31  |  660 b   |  27 lines

  1. # DERIVATES: Please provide your own distro class and patch this statement
  2. from Ubuntu import Distribution
  3.  
  4. def get_distro():
  5.     """
  6.     Returns a distribution class instance that contains information and methods
  7.     corresponding to the used distribution
  8.     """
  9.     distro = Distribution()
  10.     return distro
  11.  
  12. def get_lsb_info():
  13.     """
  14.     Returns the LSB information in a tuple:
  15.      - ID
  16.      - Codename
  17.      - Description
  18.      - Release
  19.     """
  20.     lsb_info = ()
  21.     for lsb_option in ["-i", "-c", "-d", "-r"]:
  22.         pipe = os.popen("lsb_release %s -s" % lsb_option)
  23.         lsb_info.append(pipe.read().strip())
  24.         del pipe
  25.     return(lsb_info)
  26.  
  27.